import 'package:flutter_wan_android/api/api_server.dart';
import 'package:flutter_wan_android/bean/wechat_bean.dart';
import 'package:flutter_wan_android/blocs/base/bloc_provider.dart';
import 'package:rxdart/rxdart.dart';

class WeChatBloc extends BaseBloc {

  BehaviorSubject<List<WeChatBean>> _subject = BehaviorSubject();
  Stream<List<WeChatBean>> get stream => _subject.stream;


  Future getWeChatNum(){
    return ApiServer.getWeChatNum().then((list){
      _subject.sink.add(list);
    }).catchError((error){
      _subject.sink.add(error);
    });
  }

  @override
  void dispose() {
    _subject.close();
  }
}
